package com.neo.sk.models

import models.Tables
import models.Tables.MoUrlRow
import slick.driver.MySQLDriver.simple._
import com.neo.sk.util.DBUtil._
import org.slf4j.LoggerFactory

/**
 * User: huangshanqi
 * Date: 2015/7/12
 * Time: 20:35
 */
object MovieUrl {
  private final val logger = LoggerFactory.getLogger(getClass)


  def findAll  = db.withSession{
    implicit session  =>{
      Tables.MoUrl.list
    }
  }
  def batchInsert(list: List[MoUrlRow])  = db.withSession{
    implicit session  =>{
      Tables.MoUrl ++= list
    }
  }

  def getAllMid = db.withSession{
    implicit session =>{
      Tables.MoUrl.map(_.mid).list.distinct
    }
  }
}
